package org.example;

import com.alibaba.fastjson.JSON;
import com.michaels.core.util.StringUtils;

import java.util.HashMap;
import java.util.Map;

/** Hello world! */
public class App {
  private String name;

  public static void main(String[] args) {
//    Map<String, String> testMap = new HashMap<>();
//    testMap.put("apple.color", "red");
//    System.out.println(testMap.get("apple.color"));
    String json = "{\"page_number\":12425,\"page_size\":50}";
    if (!StringUtils.isEmpty(json)) {
      HashMap<String, Object> hashMapParams = JSON.parseObject(json, HashMap.class);
      Integer pageSize = hashMapParams.get("page_size") != null ? (int) hashMapParams.get("page_size"):50;
      Integer pageNum = hashMapParams.get("page_number") != null ? (int) hashMapParams.get("page_number"):1;
      System.out.println(pageNum);
      System.out.println(pageSize);
//      LOGGER.info("Update promotion job params:" + new Gson().toJson(hashMapParams));
    }
    //        App app = new App();
    //        app.name = "zhangsan";
    //        String newName = app.name;
    //        app.name = "lisi";
    //        System.out.println( "name=" + app.name);
    //        System.out.println( "newName=" + newName);
//    for (MyEnum myEnum : MyEnum.values()) {
//      System.out.println(myEnum.name());
//      System.out.println(myEnum.ordinal());
//      System.out.println(myEnum.getName());
//      System.out.println(myEnum.getValue());
//


//    }
////    System.out.println(MyEnum.valueOf("red"));
//    System.out.println(MyEnum.valueOf("RED_BLACK"));
//    System.out.println(MyEnum.valueOf("RED"));
  }
}
